package br.com.SRP.Controle;

import java.util.List;


import br.com.SRP.Dao.Eqp08CombustivelDAO;
import br.com.SRP.Modelo.Eqp08Combustivel;

public class ControlCombustivel {
	
 
		private Eqp08CombustivelDAO combustivelDao;

		private Eqp08Combustivel combustivel;

		private int codigo; 

		public ControlCombustivel() {
			combustivel = new Eqp08Combustivel();
			combustivelDao = new Eqp08CombustivelDAO();

		}

		public void remove(int codigo) {
			System.out.println(codigo);
			this.combustivel.setCodigo(codigo);
			combustivelDao.excluir(this.combustivel.getCodigo());
			this.combustivel = new Eqp08Combustivel();
		}

		public void save(Eqp08Combustivel co) throws Exception {
			combustivelDao.salvar(co);
		}
		
		public void merge(Eqp08Combustivel co)
		{ 
			combustivelDao.atualizar(co);
		}

		public List<Eqp08Combustivel> getCombustivel() {
			return combustivelDao.listar();
		}

		
	}
